Optimal. Leaf size=50 \[ -\frac{i}{2 d (a+i a \tan (c+d x))}+\frac{i \log (\cos (c+d x))}{a d}+\frac{x}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0552606, antiderivative size = 50, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {3540, 3475} \[ -\frac{i}{2 d (a+i a \tan (c+d x))}+\frac{i \log (\cos (c+d x))}{a d}+\frac{x}{2 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3540
Rule 3475
Rubi steps
\begin{align*} \int \frac{\tan ^2(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac{i}{2 d (a+i a \tan (c+d x))}+\frac{\int (a-2 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac{x}{2 a}-\frac{i}{2 d (a+i a \tan (c+d x))}-\frac{i \int \tan (c+d x) \, dx}{a}\\ &=\frac{x}{2 a}+\frac{i \log (\cos (c+d x))}{a d}-\frac{i}{2 d (a+i a \tan (c+d x))}\\ \end{align*}
Mathematica [A] time = 0.291808, size = 86, normalized size = 1.72 \[ \frac{4 \tan ^{-1}(\tan (d x)) (\tan (c+d x)-i)+2 \log \left (\cos ^2(c+d x)\right )+\tan (c+d x) \left (2 i \log \left (\cos ^2(c+d x)\right )-2 d x+i\right )+2 i d x-1}{4 a d (\tan (c+d x)-i)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.022, size = 59, normalized size = 1.2 \begin{align*}{\frac{-{\frac{3\,i}{4}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{ad}}-{\frac{1}{2\,ad \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{{\frac{i}{4}}\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{ad}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.32638, size = 161, normalized size = 3.22 \begin{align*} \frac{{\left (6 \, d x e^{\left (2 i \, d x + 2 i \, c\right )} + 4 i \, e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{4 \, a d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 2.76378, size = 68, normalized size = 1.36 \begin{align*} \frac{\left (\begin{cases} 3 x e^{2 i c} - \frac{i e^{- 2 i d x}}{2 d} & \text{for}\: d \neq 0 \\x \left (3 e^{2 i c} - 1\right ) & \text{otherwise} \end{cases}\right ) e^{- 2 i c}}{2 a} + \frac{i \log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{a d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.62005, size = 81, normalized size = 1.62 \begin{align*} -\frac{\frac{3 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a} + \frac{i \, \log \left (i \, \tan \left (d x + c\right ) - 1\right )}{a} + \frac{-3 i \, \tan \left (d x + c\right ) - 1}{a{\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]